package jsu.yym.tiktok.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jsu.yym.tiktok.pojo.File;
import jsu.yym.tiktok.pojo.User;
import jsu.yym.tiktok.pojo.Video;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;

@Mapper
public interface FileMapper extends BaseMapper<File> {
    //根据username和文件名获取对象
    File getVideoByUserNameAndState(@Param("username") String username, @Param("file_name") String file_name);

    //根据username获取集合
    @Select("select * from file where username = #{username}")
    List<File> getFileByUsername(String username);

    //根据username获取用户id集合
    @Select("select pk_id from file where username = #{username}")
    List<Integer> getPkIDByUsername(String username);
}
